#FROM php:5.6-fpm
FROM php:8.0-fpm
#RUN docker-php-ext-install mysqli
RUN docker-php-ext-install pdo_mysql

RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak
RUN echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free" >/etc/apt/sources.list
RUN echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free" >>/etc/apt/sources.list
RUN echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free" >>/etc/apt/sources.list
RUN echo "deb http://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free" >>/etc/apt/sources.list

RUN apt-get update
RUN apt-get install -y zlib1g=1:1.2.11.dfsg-1+deb10u2 --allow-downgrades

RUN apt-get install -y zlib1g-dev libzip-dev libpng-dev libfreetype6-dev libjpeg62-turbo-dev
RUN docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/
RUN docker-php-ext-install gd iconv
RUN docker-php-ext-install fileinfo zip

# install composer
RUN curl -sS https://getcomposer.org/installer | php
RUN mv composer.phar /usr/local/bin/composer
RUN composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

#RUN apt-get install -y zlib1g-dev libfreetype6-dev libjpeg62-turbo-dev libpng-dev
#RUN docker-php-ext-install gd iconv

#RUN docker-php-ext-install gd iconv


EXPOSE 9000